Lecture 11 — from manually configuring servers to declaring infrastructure in code, automating the path to production with Continuous Delivery, and building industrial-grade pipelines with Jenkins.
"The server was configured by hand 3 years ago by someone who has since left the company. Nobody knows what's on it. Nobody dares touch it." — the "Snowflake Server" anti-pattern
Every server is unique. Subtle differences cause "works in staging, breaks in production" bugs that take days to diagnose.
Over time, manual patches and hotfixes cause servers to diverge from their original state. No two servers in the "same" cluster are actually identical.
If a manually configured server dies, rebuilding it from scratch takes weeks of guesswork. There is no "blueprint" to follow.
IaC is the practice of managing and provisioning computing infrastructure through machine-readable definition files, rather than through manual hardware configuration or interactive tools. Infrastructure is treated exactly like application source code — versioned in Git, reviewed in Pull Requests, and tested automatically.
| Tool | Type | Primary Use | Language |
|---|---|---|---|
| Terraform | Declarative | Provisioning cloud resources (AWS VPCs, EC2, S3, Azure VMs). Multi-cloud. | HCL (.tf files) |
| Ansible | Imperative (Procedural) | Configuration management — install software, manage files, run commands on existing servers. | YAML (.yml playbooks) |
| Puppet | Declarative | Configuration management for large fleets; agent-based enforcement of desired state. | Puppet DSL (.pp manifests) |
| CloudFormation | Declarative | AWS-only provisioning. Deep integration with AWS services. | JSON / YAML |
| Docker / K8s | Declarative | Container images (Dockerfile) and orchestration (K8s YAML manifests). | Dockerfile / YAML |
Key distinction: Terraform provisions the infrastructure (creates the servers). Ansible/Puppet configure what runs on them. In practice, teams use Terraform + Ansible together.
Downloads the AWS provider plugin.
Dry run — shows what WILL be created without doing it.
Actually creates the EC2 instance in AWS. Type "yes" to confirm.
Run two identical production environments. "Blue" is live. Deploy new version to "Green." Switch the load balancer to Green. If it fails, switch back to Blue instantly.
⚡ Zero-downtime rollback.
Route 5% of real user traffic to the new version. Monitor error rates and latency. If healthy, gradually ramp to 25% → 50% → 100%. If unhealthy, abort and roll back.
🐦 Named after canaries in coal mines.
Replace instances one at a time. Server 1 is updated while 2-10 handle traffic. Then Server 2, etc. Used by Kubernetes by default.
🔄 No extra infrastructure needed.
Take the entire system offline, deploy the new version, pray, and bring it back up. High risk, maximum downtime, zero rollback path.
🚫 Avoid in modern DevOps.
The practice of automatically and constantly observing infrastructure, applications, and security posture in real-time. It generates the feedback data that flows back from the "Operate/Monitor" phase into the "Plan" phase, completing the DevOps infinity loop.
The DevOps Research and Assessment (DORA) team at Google identified four key metrics that predict software delivery performance. Elite teams score high on all four.
How often code is deployed to production. Elite: multiple times/day.
Time from commit to production. Elite: less than 1 hour.
% of deployments that cause a failure. Elite: 0-15%.
Time to restore service after a failure. Elite: less than 1 hour.
| Feature | Jenkins | GitHub Actions |
|---|---|---|
| Hosting | Self-hosted (you manage the server) | Cloud-hosted (GitHub manages runners) |
| Setup | Install Java, Jenkins, configure manually | Zero setup — add a YAML file to your repo |
| Config | Jenkinsfile (Groovy DSL) | .github/workflows/*.yml (YAML) |
| Plugins | 1,800+ (massive ecosystem, but some are outdated) | Marketplace Actions (modern, community-driven) |
| Best For | Complex enterprise pipelines with many integrations | GitHub-native projects wanting fast, simple CI/CD |
| Cost | Free software, but you pay for server infrastructure | Free tier (2,000 min/month); pay-per-minute after |
Key concepts: pipeline wraps everything. agent any means run on any available worker. stages run sequentially. The when directive ensures Deploy only runs on the main branch. post handles success/failure notifications.
mvn compile, npm build)Metrics tools; DevOps lifecycle; Digital transformation & role of DevOps.
Think about which DORA metric your future team would struggle with most and why. We'll discuss digital transformation through the lens of these metrics.